// created by noellynch
// Jun 3, 2009

package com.sceneworker.jmetreeextensions;

import java.util.Vector;

import com.acarter.composabletree.ComposableTreeModel;
import com.acarter.composabletree.ComposableTreeNode;
import com.acarter.jmejtree.treenode.ControllerTreeNode;
import com.acarter.jmejtree.treenode.LightStateTreeNode;
import com.acarter.jmejtree.treenode.LightTreeNode;
import com.acarter.jmejtree.treenode.PassNodeStateRenderStateTreeNode;
import com.acarter.jmejtree.treenode.PassNodeStateTreeNode;
import com.acarter.jmejtree.treenode.PassNodeTreeNode;
import com.acarter.jmejtree.treenode.RenderStateTreeNode;
import com.acarter.jmejtree.treenode.SpatialTreeNode;
import com.acarter.jmejtree.treenode.TextureStateTreeNode;
import com.acarter.jmejtree.treenode.TextureTreeNode;

public class SceneWorkerComposableTreeModel extends ComposableTreeModel {

	/**
	 * @param root
	 */
	public SceneWorkerComposableTreeModel(Object root) {
		super(root);
		
		// ---------------------------------------------- NODE
		SpatialTreeNode 		lcl_spatialTN = new SpatialTreeNode();
		RenderStateTreeNode 	lcl_renderstateTN = new RenderStateTreeNode();
		ControllerTreeNode 		lcl_controllerTN = new ControllerTreeNode();
		
		Vector<ComposableTreeNode> lcla_spatialTNChildren = new Vector<ComposableTreeNode>();
		lcla_spatialTNChildren.add(lcl_renderstateTN);
		lcla_spatialTNChildren.add(lcl_controllerTN);
		lcla_spatialTNChildren.add(lcl_spatialTN);
	
		addNodeType(lcl_spatialTN, lcla_spatialTNChildren);
		addNodeType(lcl_renderstateTN, new Vector<ComposableTreeNode>());
		addNodeType(lcl_controllerTN, new Vector<ComposableTreeNode>());
		
		// ---------------------------------------------- LIGHT
		LightStateTreeNode lightState = new LightStateTreeNode();
		LightTreeNode light = new LightTreeNode();
		
		Vector<ComposableTreeNode> lightStateChildren = new Vector<ComposableTreeNode>();
		lightStateChildren.add(light);
		
		addNodeType(lightState, lightStateChildren);
		addNodeType(light, new Vector<ComposableTreeNode>());
		
		// ---------------------------------------------- TEXTURE
		TextureStateTreeNode 		lcl_textureStateTN = new TextureStateTreeNode();		// state node
		SceneWorkerTextureTreeNode 	lcl_textureTN = new SceneWorkerTextureTreeNode();		// texture node
		
		// state node has texture children
		Vector<ComposableTreeNode> 	lcl_textureStateChildren = new Vector<ComposableTreeNode>();
		lcl_textureStateChildren.add(lcl_textureTN);
		
		// texture can have spatial children if it is defined by a texture renderer
		TextureTreeNodeSpatialTreeNode		lcl_textureTNSpatial = new TextureTreeNodeSpatialTreeNode();
		Vector<ComposableTreeNode>			lcl_textureTNChildren = new Vector<ComposableTreeNode>();
		lcl_textureTNChildren.add(lcl_textureTNSpatial);
		
		addNodeType(lcl_textureStateTN, lcl_textureStateChildren);
		addNodeType(lcl_textureTN, lcl_textureTNChildren);
		
		// ---------------------------------------------- PASS NODE
		PassNodeTreeNode passNode = new PassNodeTreeNode();
		PassNodeStateTreeNode passNodeState = new PassNodeStateTreeNode();
		
		Vector<ComposableTreeNode> passNodeChildren = new Vector<ComposableTreeNode>();
		passNodeChildren.add(lcl_renderstateTN);
		passNodeChildren.add(lcl_controllerTN);
		passNodeChildren.add(lcl_spatialTN);
		passNodeChildren.add(passNodeState);
		
		addNodeType(passNode, passNodeChildren);
		
		PassNodeStateRenderStateTreeNode passNodeStateRenderState = new PassNodeStateRenderStateTreeNode();

		Vector<ComposableTreeNode> passNodeStateChildren = new Vector<ComposableTreeNode>();
		passNodeStateChildren.add(passNodeStateRenderState);
		
		addNodeType(passNodeState, passNodeStateChildren);
		
		// ---------------------------------------------- KEY BINDING MANAGER
		
	}
}
